﻿<?xml version="1.0" encoding="utf-8" ?>
<Batch 
    xmlns="http://schemas.dbshell.com/core"
    xmlns:rds="http://schemas.dbshell.com/datasync"
    >
    <rds:SyncModel >
        <rds:SyncModel.Sources>
            <rds:Source SourceTableVariable="SourceName">
                <rds:SourceColumn Name="SourceId" />
                <rds:SourceColumn Name="Value" />
            </rds:Source>
            <rds:Source SourceQueryVariable="SourceQuery">
                <rds:SourceColumn Name="SourceId2" />
                <rds:SourceColumn Name="Value2" />
            </rds:Source>
        </rds:SyncModel.Sources>
        <rds:SyncModel.Targets>
            <rds:Target FullTableNameVariable="TargetName">
                <rds:TargetColumn Name="TargetIdOriginal" Source="SourceId" IsKey="True"/>
                <rds:TargetColumn Name="Value" Source="Value" />
                <rds:TargetColumn Name="ParamId" Value="1" IsRestriction="True" />
            </rds:Target>
            <rds:Target FullTableNameVariable="TargetName">
                <rds:TargetColumn Name="TargetIdOriginal" Source="SourceId2" IsKey="True"/>
                <rds:TargetColumn Name="Value" Source="Value2" />
                <rds:TargetColumn Name="ParamId" Value="2" IsRestriction="True" />
            </rds:Target>
        </rds:SyncModel.Targets>
        <rds:SyncModel.Parameters>
            <rds:Parameter Name="TargetName" DataType="nvarchar(50)" />
            <rds:Parameter Name="SourceName" DataType="nvarchar(50)" />
            <rds:Parameter Name="SourceQuery" DataType="nvarchar(50)" />
        </rds:SyncModel.Parameters>
    </rds:SyncModel>

    <rds:CreateProcedure ProcName="RunSync1" />
</Batch>
